//
//  NetworkRequest+HomePage.m
//  URLDemo
//
//  Created by rimi on 15/9/29.
//  Copyright (c) 2015年 yangqin. All rights reserved.
//

#import "NetworkRequest+HomePage.h"
@implementation NetworkRequest (HomePage)

- (void)getHomePageDataWithParameters:(NSDictionary *)parameters successHandle:(SuccessBlock)success failureHandle:(failureBlock)faile {
    [self post:kHomePageURL parameters:parameters successHandle:^(NSString *responds) {
        if (success) {
            success([self parse:responds]);
        }
    } failureHandle:^(NSError *error) {
        
    }];
}

- (NSArray *) parse:(NSString *)parseStr {
    NSArray *nodeNames = @[@"url", @"index",@"isOpen", @"detailUrl", @"content"];
    Parse *parse = [[Parse alloc] init];
    NSArray *resultArr = [parse parse:parseStr nodePath:@"////com.chinaxyl.show.pojo.MediaPojo" nodeNames:nodeNames];
    NSArray *convertArray = [self covertURL:resultArr];

    return convertArray;
}

@end
